//
//  AsSheet.swift
//  onemeetingmac
//
//  Created by 张衡 on 2020/3/2.
//  Copyright © 2020 onemeeting. All rights reserved.
//

import Foundation

class AsSheet: NSObject {
    
    class func exitRoom() {
        let isjoin = Td.sh().isJoin
        let btnTitles = isjoin ? ["离开会议","取消"]:["结束会议","离开会议","取消"]
        let msg = isjoin ? "点击“离开会议“即可离开会议":"如果您不想结束会议，请在点击“离开会议“前指定新的主持人。"
        let title = isjoin ? "离开会议":"结束会议"
        let controller = KlViewController.init(title: title, massage: msg, buttomTitles: btnTitles, indexBlock: { (index, control) in
            if isjoin {
                if index == 0 {
                    MTNot.onExitRoom(isLeave: true)
                }
            }else {
                if index == 1 {
                    MTNot.onExitRoom(isLeave: true)
                }else if index == 0{
                    MTNot.onExitRoom(isLeave: false)
                }
            }
            
        }, navBlock: nil)
        let window = NSWindow.init(contentViewController: controller)
        window.makeKeyAndOrderFront(nil)
    }
    
}
